#!/usr/bin/env python2
import os
import subprocess
import re

#nodes = []

print 'digraph a {'

for node, dirs, files in os.walk('.'):
	for item in files:
		if not item.endswith('.py'):
			continue
		f = file(node + '/' + item, 'r')
		data = f.read()
		f.close()
		matches = re.finditer('class (?P<name>[a-zA-Z0-9_]+)(\((?P<parent>[a-zA-Z0-9_]+)\))?', data)
#		for match in matches:
#			print match.group('name')
		#print matches.group('name')
		for match in matches:
			print '	%s -> %s;' % match.group('name','parent')
#			print match.group('name')
#			print match.group('parent')

print '}'
